<?php

namespace ai\app\libs;

include_once(__DIR__ . '/orm.php');

class Libs
{
    /**
     * @var Orm
     */
    public $orm;


    function __construct()
    {
        $this->orm = new Orm();
    }

    /**
     * @param $wx_account
     * @return Wechatapi
     */
    public function wechat($wx_account)
    {
        include_once(__DIR__ . '/wechatapi.php');
        return new Wechatapi($wx_account);
    }

    public function backtrace(){
        $root=dirname(dirname(dirname(dirname(__FILE__))));
        $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT);


        var_dump($trace);
        //echo json_encode($trace);
        exit;

        $model=$trace[1];
        $model["file"]=str_replace($root,"",$model["file"]);
        $model["class"]=str_replace('ai\\db\\query\\base\\',"",$model["class"]);

        echo json_encode($model);exit;
    }
}

